<?php
switch($action){
    case 'get_data':
        $sql = "SELECT *,FROM_UNIXTIME(add_time,'%Y') as design_year,FROM_UNIXTIME(add_time,'%m') as design_month FROM design_design WHERE provider_id='{$provider_id}' AND design_id!='{$design_id}' LIMIT 0,6";
        $related_data = $db->fetch_all($sql);
        echo array2json($related_data);
        exit();
        break;
    default:
        include './module/include/right.inc.php';
        $sql = "SELECT *,FROM_UNIXTIME(add_time,'%Y') as design_year,FROM_UNIXTIME(add_time,'%m') as design_month FROM design_design WHERE design_id='{$design_id}' LIMIT 0,1";
        $data = $db->fetch_first($sql);
        $pic_folder = "./attachment/design/{$data['design_year']}/{$data['design_month']}/{$data['provider_id']}/{$data['design_id']}/";
        break;
}
?>